//
//  DialogViewController.swift
//  sss
//
//  Created by hrrMac on 2020/6/2.
//  Copyright © 2020 hrrMac. All rights reserved.
//

import UIKit

class DialogViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad();
        do {
            let btn = UIButton()
            btn.yo.text("第一个按钮").textColor("ff0000").backgroundColor("FFFF00")
            view.addSubview(btn)
            
            btn.snp.makeConstraints { (make) in
                make.left.equalTo(50)
                make.top.equalTo(50)
                make.size.equalTo(100)
            }
            
            btn.btnTouch { [self] in
                self.show1()
            };
        }
        
        do {
            let btn = UIButton()
            btn.yo.text("第二个按钮").textColor("ff0000").backgroundColor("FFFF00")
            view.addSubview(btn)
            
            btn.snp.makeConstraints { (make) in
                make.left.equalTo(50)
                make.top.equalTo(200)
                make.size.equalTo(100)
            }
            
            btn.btnTouch { [self] in
                self.show2()
            };
        }
        
        
        
    }
    
    
    func show1(){
        let dialog = DialogView.showDilogiView(self.oneTestAlertUI())
    }
    
    ///底部
    func show2(){
        let dialog = DialogView.showDilogiView(self.oneTestAlertUI(),type: .bottom)
    }
    

    
    func oneTestAlertUI() -> UIView{
        let view = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 300))
        view.backgroundColor = UIColor.white
        return view
    }
    

}
